export const comment = {
  state() {
    return {
      commentsList: [
        {
          id: +new Date(),
          name: "张三",
          time: +new Date(),
          comment: "我是王五我是王五我是王五",
        },
        {
          id: +new Date(),
          name: "张四",
          time: +new Date(),
          comment: "我是张四张四张四张四",
        },
        {
          id: +new Date(),
          name: "张五",
          time: +new Date(),
          comment: "我是张五张五张五张五",
        },
        {
          id: +new Date(),
          name: "张六",
          time: +new Date(),
          comment: "我是张六张六张六张六",
        },
        {
          id: +new Date(),
          name: "张七",
          time: +new Date(),
          comment: "我是张七张七张七张七",
        },
      ],
    };
  },
  mutations: {
    addComments(state, val) {
      state.commentsList.push(val);
    },
  },
  actions: {
    async addCommentSync(context, val) {
      context.commit("addComments", val);
    },
  },
};
